import request from '@/utils/request'

// 查询列表
export function list (query) {
  return request({
    url: '/datacenter/sysDataVersion/integratedSearch',
    method: 'get',
    params: query,
  })
}

export function listAll (query) {
  return request({
    url: '/test/dictItems/getLevel3/sjlb',
    method: 'get',
    params: query,
  })
}

// 获取数据元信息
export function getDetail (id) {
  return request({
    url: '/datacenter/sysDataVersion/getMetaDataByVersionCode/' + id,
    method: 'get'
  })
}

// 删除行政区划
export function delAdministrativeArea (id) {
  return request({
    url: '/datacenter/sysDataVersion/del',
    method: 'post',
    data: id
  })
}

// 删除前检查那些系统使用
export function dataVersionIsUseForDel (query) {
  return request({
    url: '/datacenter/sysDataVersion/dataVersionIsUseForDel',
    method: 'get',
    params: query
  })
}
// 获取数据类别
export function getDataTye () {
  return request({
    url: '/test/dictItems/getDictItemByDictCode/sjlb',
    method: 'get'
  })
}

// 获取数据类别
export function getDataTyes (data) {
  return request({
    url: '/test/dictItems/getDictItemByDictCode/' + data,
    method: 'get'
  })
}

// 获取数据类别
export function getChildDataType (code) {
  return request({
    url: '/test/dictItems/getDictItemByDictCode/' + code,
    method: 'get'
  })
}

// 获取版本号
export function getVersionCode (code) {
  return request({
    url: '/datacenter/sysDataVersion/getVersionCodeList/' + code,
    method: 'get'
  })
}